package com.itheima.recursion_multi;

/**
 * 递归求斐波那契第n项
 *
 * @FileName E06Fibonacci
 * @Description
 * @Author Sword
 * @date 2025-03-12
 **/
public class E06Fibonacci {

    public static int f(int n) {
        if (n == 0) {
            return 0;
        }

        if (n == 1) {
            return 1;
        }
        return f(n - 1) + f(n - 2);
    }

    public static void main(String[] args) {
        int f = f(3);
        System.out.println(f);
    }
}
